import React from "react";

const Home = React.lazy(() => import("../views/home"));
const List = React.lazy(() => import("../views/list"));
const MainLayout = React.lazy(() => import("../views/mainLayout"));
const Set = React.lazy(() => import("../views/set"));
const Table = React.lazy(() => import("../views/table"));

export interface RouteRawState {
  path: string;
  element: JSX.Element;
  children?: RouteRawState[];
  meta?: {
    label?: string;
    icon?: JSX.Element;
  };
}
export const mainLayoutChildren: RouteRawState[] = [
  {
    path: "/",
    element: <Home></Home>,
    meta: {
      label: "首页",
    },
  },
  {
    path: "/list",
    element: <List></List>,
    meta: {
      label: "列表",
    },
  },

  {
    path: "/set",
    element: <Set></Set>,
    meta: {
      label: "设置",
    },
  },
  {
    path: "/table",
    element: <Table></Table>,
    meta: {
      label: "图表",
    },
  },
];
export const routes: RouteRawState[] = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: mainLayoutChildren,
  },
];
